﻿using System;
using System.Collections.Generic;

namespace TfsGiggle.Core.IntegrationTest
{
    class MockChangeset : IChangeset
    {
        private int _changesetId;
        private List<IChange> _changes;
        private List<IWorkitem> _workitems;

        internal MockChangeset()
        {
            _changes = new List<IChange>();
            _workitems = new List<IWorkitem>();
        }

        internal MockChangeset MockId(int id) { _changesetId = id; return this; }
        internal MockChangeset MockAddFile(string name, string content)
        {
            _changes.Add(new MockChange(_changesetId, name, content));
            return this;
        }

        internal MockChangeset MockAddChange()
        {
            return this;
        }

        public IChange[] Changes
        {
            get { return _changes.ToArray(); }
        }

        public IWorkitem[] WorkItems
        {
            get { return _workitems.ToArray(); }
        }

        public int ChangesetId
        {
            get { return _changesetId; }
        }

        public string Committer
        {
            get { return Environment.UserDomainName + "\\" + Environment.UserName; }
        }

        public string Comment
        {
            get { return "Comment1"; }
        }
    }
}
